<script setup>
import {
  ref,
  reactive,
  defineEmits,
} from 'vue';

const name = ref('UnionDrug');
const data = reactive({
  name: 'UnionDrug',
  attr: '保险',
});

const emits = defineEmits(['clickFn', 'nameFn']);
console.log('emits', emits);

const tellParentData = () => {
  emits('clickFn', data);
  emits('nameFn', name);
};
</script>

<template>
  <button @click="tellParentData">
    name is: {{ name }}
  </button>
</template>

<style scoped>
button {
  color: v-bind(color);
}
</style>
